You can choose one of the two way to empower your app with beauty effect provided by RTC SDK.

Prerequisite
Procedure
1. Integrating the beauty module
  1. locate the dynamic library files from the RTC SDK.

    • Windows: VolcEngineRTC/bin/Win32(x64)/effect.dll and pthreadVC2.dll
    • macOS: libeffect.dylib
  2. Update the packing setting to copy the dynamic library files to the designate directory.
    For the electron-builder, specify the target path in the field of extraResources.

    • Windows: Same folder as the main program
    • macOS: Frameworks/*
  "build": {
    "win": {
       "extraResources": [
        {
          "from": "./effect.dll",
          "to": "../effect.dll" 
        },
        {
          "from": "./pthreadVC2.dll",
          "to": "../pthreadVC2.dll" 
        }
      ]
    },
    "mac": {
       "extraResources": [
        {
          "from": "./libeffect.dylib",
          "to": "../Frameworks/libeffect.dylib"
        }
      ]
    }
  }
json
2. Add resource
basic_beauty/
  ComposeMakeup/
    beauty_Android_lite/
    ...
TypeScript
3. Initialize

在创建引擎后,Call startVideoCapture to start the local video capture after creating the veRTCVideo.

const rtcVideo= new veRTCVideo();
rtcVideo.startVideoCapture();
TypeScript
4. Enable beauty effect

Call enableEffectBeauty and pass true to the argument enable to enable the beauty effect.

It returns -1004 for the first call of enableEffectBeauty time after the app installation. This results for SDK is downloading the necessary files for the beauty feature. Once the download has been completed, subsequent call to this API returns 0 and that you can instantly preview the beauty effect for the local video capture.

The intensity of the buffing/sharpening/clarity is set to 0.5 by default.

let ret = rtcVideo.enableEffectBeauty(true);
TypeScript
5. Set intensity fot the effect

Call setBeautyIntensity to set the beauty effect intensity either before or after enabling the beauty effect.
It ranges from 0 to 1. When it was set to 0 or a value beyond the range, the beauty effect is disabled.

  • You lost your intensity setting once the video engine is destroy. The settings revert to their default values when the video engine is recreated.
let ret = rtcVideo.setBeautyIntensity(EffectBeautyMode.kEffectBeautyWhite, 0.8);
TypeScript
6. Disabled beauty effect

Call enableEffectBeauty and pass false to the argument enable to disable the beauty effect.